package com.newmainsoftech.dao;

import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.newmainsoftech.eatestutil.ejbtestutil.AbstractEntityManagerFacade7Impl;
import com.newmainsoftech.eatestutil.ejbtestutil.EntityManagerFacade;

/**
 * EJB test helper class to merely use <code>EntityManager</code> instance from 
 * outside of EJB beans managed by EJB container.<br />
 * Be advised to be aware that <code>EntityManager</code> is not thread-safe and this as well.  
 * 
 * @author Arata Y.
 */
@Stateless( name = "EntityManagerFacadeImpl")
@Local( value = { EntityManagerFacade.class})
public class EntityManagerFacadeImpl extends AbstractEntityManagerFacade7Impl {
	@PersistenceContext( unitName = EjbTestCommonProperty.TestPersistenceUnitName)
	private EntityManager entityManager;
		public EntityManager getEntityManager() {
			return entityManager;
		}
	public String getPersistenceUnitName() {
		return EjbTestCommonProperty.TestPersistenceUnitName;
	}
}
